<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>我的信息</title>
		<meta name="author" content="keakon" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<style type="text/css">
		</style>
	</head>
	<body>
		<form method="post">
			<%def name="fieldRow(type, label, id, value, size=0, text=[], expectedValue='')">
			<tr>
				<td>
					<label for="${id}">${label}</label>
				</td>
				<td>
					% if type == 'input':
					<input type="text" id="${id}" name="${id}" value="${value | trim, h}" maxlength="${size}" size="${size}" />
					% elif type == 'text':
					<span id="${id}">${value}</span>
					% elif type == 'select':
					<select id="${id}" name="${id}">
						% for option in zip(value, text):
						<option value="${option[0]}" ${'selected="selected"' if option[0] == expectedValue else ''}>${option[1]}</option>
						% endfor
					</select>
					% else:
					${value}
					% endif
				</td>
			</tr>
			</%def>
			
			<%def name="option(text, value, expectedValue)">
			<option value="${value}" ${'selected="selected"' if value == expectedValue else ''}>${text}</option>
			</%def>
			% if registering:
			您还未注册，需填写以下信息：
			% endif
			<table>
			${fieldRow('input', u'用户名', 'name', user.name)}
			% if not registering:
			${fieldRow('text', u'注册邮箱', '', user.user.email())}
			${fieldRow('text', u'注册时间', '', user.register_date)}
			% endif
			${fieldRow('select', u'分级', 'classification', [0, 1, 2], text=[u'全年龄', u'15禁', u'18禁'], expectedValue=user.classification)}
			${fieldRow('input', u'QQ中转站线路', 'qq_line', user.qq_line or '', 2)}
			${fieldRow('input', u'Foxmail中转站线路', 'fm_line', user.fm_line or '', 2)}
			% if not registering:
			${fieldRow('text', u'ACG币', '', user.money or 0)}
			${fieldRow('text', u'积分', '', user.rating or 0)}
			% endif
			</table>
			% if registering:
			<input type="hidden" id="registering" name="registering" value="yes" />
			% endif
			<input type="submit" />
		</form>
	</body>
</html>